<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr=[1,2,3];
        arr.forEach(function(value,index,array){
            console.log(value);
        })
        //箭头函数写法
        arr.forEach((value,index,array)=>console.log(array));
        let obj={
            // fn:()=>{
            //     return 1; 
            // }
            //因为只有一行代码，所以可以不用大括号，而去除大括号之后会报语法错误，所以不用return
            fn:()=>1
        }
        console.log(obj.fn());
    </script>
</body>
</html>